import request from '@/utils/request';

const prefix = '/users';

export const createUser = (data) => request.post(`${prefix}`, data);
export const getUserList = (data) =>
  request.get(`${prefix}`, {
    params: data,
  });

export const deleteUser = (id) => request.delete(`${prefix}/${id}`);

export const getUserDetail = (id) => request.get(`${prefix}/${id}`);
export const updateUser = (id, data) => request.put(`${prefix}/${id}`, data);

export const disableUser = (id) => request.post(`${prefix}/${id}/disable`);
export const enableUser = (id) => request.post(`${prefix}/${id}/enable`);

export const resetPassword = (id) =>
  request.post(`${prefix}/${id}/resetPassword`);

export const setSuperAdmin = (id) =>
  request.post(`${prefix}/${id}/setSuperAdmin`);

export const recycleSuperAdmin = (id) =>
  request.post(`${prefix}/${id}/recycleSuperAdmin`);
